<#import "/manage/layout/html_base.ftl" as  html />
<@html.htmlbase>
 <div class="container" >
    <div class="row">
        <div class="col-lg-5">
            <div class="panel">
                <div class="panel-body">
                     <#if configs??>

                             <table class="table table-bordered">
                                 <tr class="text-center">
                                     <td colspan="3">System Properties</td>
                                 </tr>
                                 <#list configs?values as conf>
                                     <tr>
                                         <td class="text-right h4"><b class="label label-info ">${conf.getKey()}</b></td>
                                         <td>${conf.getValue()}</td>
                                         <td>
                                             <a class="btn btn-xs btn-primary" href="javascript:Update(${conf.getId()})"><i class="fa fa-edit"></i></a>
                                         </td>
                                     </tr>
                                 </#list>
                             </table>
                         <form  class="text-center" action="${basepath}/manage/config/refresh" method="post">
                             <input type="submit" class="btn btn-success" value="refresh">
                         </form>
                     </#if>
                </div>
            </div>
        </div>
        <div class="col-lg-5">
            <div class="panel">
                <div class="panel-body">
                    <table class="table table-bordered">
                        <tr class="text-center">
                            <td colspan="2">
                                系统状态
                            </td>
                        </tr>
                        <tr>
                            <td>内存消耗(已用/总共)：</td>
                            <td>${usedMemory}M <span class="h4">/</span>${totalMemory}M | ${memoryPercent}%</td>
                        </tr>
                        <tr>
                            <td>操作系统：</td>
                            <td>${os}</td>
                        </tr>
                        <tr>
                            <td>JAVA版本：</td>
                            <td>${javaVersion}</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
 </div>

 <div class="modal " id="addModal" tabindex="-1" role="dialog" aria-hidden="true">
     <div class="modal-dialog">
         <div id="addContent" class="modal-body">
         </div>
     </div>
 </div>
     <script type="text/javascript">

          var update = "http://localhost:8016/manage/config/update";
          function Update(id){
              var url = update ;
              if(id > 0){
                  url = url + "?id=" + id;
              }
              console.info(url);
              $.ajax({
                  url :url,
                  type:"Get",
                  success  : function(data)
                  {
                      $('#addContent').html(data);
                      $('#addModal').modal('show');
                  }
              });
          }
     </script>
</@html.htmlbase>